package in.smartbillpay.web.models;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.NotEmpty;

@Entity
@Table(name="District")
public class District {
	
	@Id @GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="Id") 
	private int id;
	
	@NotEmpty(message="Name field is mandatory.")
	@Size(min=1, max=35)
	@Column(name="Name")
	private String name;
	
	@ManyToOne
	@JoinColumn(name="StateId")
	private State state;

	/*
	@OneToMany(mappedBy="district")
	private Collection<City> cityList= new ArrayList<City>();
	*/
	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the state
	 */
	public State getState() {
		return state;
	}

	/**
	 * @param state the state to set
	 */
	public void setState(State state) {
		this.state = state;
	}

	/**
	 * @return the cityList
	 */
	/*
	public Collection<City> getCityList() {
		return cityList;
	}
	*/
	/**
	 * @param cityList the cityList to set
	 */
	/*
	public void setCityList(Collection<City> cityList) {
		this.cityList = cityList;
	}

	 */

}
